package org.adg.code.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


import org.adg.code.model.JDBC;
import org.adg.code.common.JDBCproperties;

public class DBConnection {
	
	Connection getConnection()
	{
		JDBCproperties js=new JDBCproperties();
		JDBC j=js.getProperties();
		Connection con=null;
		try
		{
				Class.forName("org.postgresql.Driver");
				con = DriverManager.getConnection(j.geturl(),j.getusr(),j.getpas());
		}
		catch(ClassNotFoundException ce)
		{
			System.out.println("Driver Class Error : " + ce);
		
		}
		catch(SQLException se)
		{
			System.out.println("SQL Error in getConnection(): " + se);
		
		} 
		return con;
	}
}
